#include <bits/stdc++.h>
using namespace std;
int main() {
    freopen("arena.in","r",stdin);
    freopen("arena.out","w",stdout);
    int n; cin >> n;
    int ans=0;
    for(int i=1;i<=(n << 1);++i) {
        int x; cin >> x;
    }
    string s="heh";
    while(s.size()>1) {
        cin >> s;
    }
    int t; cin >> t;
    for(int i=1;i<=t;++i) {
        for(int j=1;j<=n;++j) {
            int x; cin >> x;
        }
        cout << n << '\n';
    }
    return 0;
}